package com.studio701.carguard.service.imp;

import com.studio701.carguard.pojo.HelpAnswer;
import com.studio701.carguard.mapper.HelpAnswerMapper;
import com.studio701.carguard.service.IHelpAnswerService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author xjc
 * @since 2022-03-16
 */
@Service
public class HelpAnswerServiceImpl extends ServiceImpl<HelpAnswerMapper, HelpAnswer> implements IHelpAnswerService {

    @Autowired
    HelpAnswerMapper helpAnswerMapper;

    @Override
    public boolean updateHelpAnswerById(HelpAnswer helpAnswer) {
        return helpAnswerMapper.updateHelpAnswerById(helpAnswer);
    }

    @Override
    public boolean removeHelpAnswerByUserIdAndQID(Integer userId, Integer qId) {
        return helpAnswerMapper.removeHelpAnswerByUserIdAndQID(userId, qId);
    }

    @Override
    public HelpAnswer getByUserIdAndQId(Integer userId, Integer qId) {
        return helpAnswerMapper.getByUserIdAndQId(userId, qId);
    }

    @Override
    public List<HelpAnswer> getByQId(Integer qId) {
        return helpAnswerMapper.getByQId(qId);
    }
}
